package com.deyuanyun.pic.settings.controller.org;

import com.deyuanyun.pic.common.util.ResponseUtil;
import com.deyuanyun.pic.settings.service.org.OrgService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 * 
 * 
 * 组织机构图
 *
 * @author    王敏
 * @version   2015年12月15日上午10:28:07
 * Method List:                       
 *				toPage 进入页面
 *				search 查询数据
 */
@Controller
@RequestMapping("/settings/org/orgStruct")
public class OrgStructController {
	@Resource
	private OrgService orgService;
	
	@RequestMapping(value="/page.html",method=RequestMethod.GET)
	public ModelAndView toPage( ModelAndView mav)
	{
		mav.setViewName("/settings/org/orgStruct");
		return mav;
	}
	
	@RequestMapping("/search.json")
	@ResponseBody
	public void search( HttpServletRequest request,Integer current,Integer pageCount,HttpServletResponse response)
	{
//		if(current != null)
//		{
//			PageHelper.startPage(current.intValue(), pageCount.intValue());
//		}
	//	HashMap param=RequestUtil.parseRequestParamToHashMap(request);
		ResponseUtil.printl(response, ResponseUtil.getJson(orgService.findData(null)).toString(), "JSON");
		
	}
}
